<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="css/ajax.css">
		<script type="text/javascript" src="js/ajax.js"></script>
		<script src="ext-core.js"></script>
		<script type="text/javascript">
			var xmlHttp;
			function Request() {
			    if (window.ActiveXObject) {
			        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			    } 
			    else if (window.XMLHttpRequest) {
			        xmlHttp = new XMLHttpRequest();
			    }
			}
			
			function start() {
			    Request();
			    xmlHttp.onreadystatechange = change;
			    xmlHttp.open("GET", "jsp/ajax.jsp", true);
			    xmlHttp.send(null);
			}
						
			function change(){
				if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
					checkLogin();
				}
			}
			
			function checkLogin(){
				var write = "";
				var jsonData = JSON.parse(xmlHttp.responseText);
				if (jsonData.CODE == 00) {
					write += "Login successful."
				}
				else if (jsonData.CODE == 88){
					write += "Login failed."
				}
				else {
					write += "Did not enter."
				}
				document.getElementById("msg").innerHTML = write;
			}

			/*
			Ext.Ajax.request({
				url: 'jsp/ajaxdata.jsp',
			
				//url: 'http://192.168.0.110:8080/esolmall_server/login.do',
				//method: 'POST',
				//params: { USER_ID:'allezfrance', USER_PW:'eodi0714'},
			
				success: function(response, opts) {
					jsonData = JSON.parse(response.responseText);
					for(var i=0; i<jsonData.DATA.length; i++){
						griddata[i] = [jsonData.DATA[i].RCV_PS, jsonData.DATA[i].RCV_ZIP_NO,  jsonData.DATA[i].RCV_ZIP1,  jsonData.DATA[i].RCV_ZIP2,  jsonData.DATA[i].RCV_TEL, jsonData.DATA[i].RCV_HP];
					}
				}
			});
			*/

		</script>
		<title>Study</title>
	</head>
	<body>
		<div id="login">
			<form action="#">
				<table>
					<tr>
						<td colspan="3"><h1>Hello, Study Index</h1></td>
					</tr>
					<tr>
						<td colspan="3"><h2>Login Form Test</h2></td>
					</tr>
					<tr>
						<td><label for="uid">ID</label></td>
						<td><input id="uid" type="text" name="USER_ID"></td>
						<td rowspan="2"><input class="bt" type="button" value="OK" onclick="start()"></td>
					</tr>
					<tr>
						<td><label for="upw">PASSWORD</label></td>
						<td><input id="upw" type="password" name="USER_PW"></td>
					</tr>
					<tr>
						
					</tr>
					<tr>
						<td colspan="3"><p id="msg">view massage</p></td>
					</tr>
				</table>
			</form>
		</div>
	</body>
</html>
